﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/// <summary>
/// 枚举及结构体的使用
/// </summary>
/*
 *name：姚铁
 *time：2017.9.6
 */
namespace training7
{
    class Program
    {
        enum playerState{
            walk,run
        }
        struct num{
            public string name;
            public int x;
            public char y;
            public float z;
        }
        static void Main(string[] args)
        {
            //声明playerstate的枚举类型
            playerState mystate;
            mystate = playerState.walk;
            if (mystate == playerState.walk) {
                mystate = playerState.run;
                Console.WriteLine(mystate);
            }
            Console.ReadKey();
            //声明num的结构体类型
            num p1;
            p1.name = "数值";
            p1.x = 1;
            p1.y = 'y';
            p1.z = 1.1f;
            Console.WriteLine(p1.name + p1.x + p1.y + p1.z);
            Console.ReadKey(); 
            
        }
    }
}
